import 'package:flutter/material.dart';

import 'package:get/get.dart';

import '../controllers/user_controller.dart';

class UserView extends GetView<UserController> {
  const UserView({super.key});
  @override
  Widget build(BuildContext context) {
    double screenWidth = MediaQuery.of(context).size.width;
    double screenHeight = MediaQuery.of(context).size.height;
    return Container(
      child: Column(
        children: [
          Container(
            width: screenWidth,
            height: screenHeight * 0.3,
            alignment: Alignment.center,
            padding: EdgeInsets.only(top: screenHeight * 0.05),
            child: Container(
              width: screenWidth * 0.9,
              height: screenHeight * 0.2,
              //  卡片修饰
              decoration: BoxDecoration(
                color: Color(0xFFF5F5F5),
                borderRadius: BorderRadius.circular(10),
              ),
              child: Column(
                mainAxisAlignment: MainAxisAlignment.center,
                crossAxisAlignment: CrossAxisAlignment.center,
                children: [
                  Container(
                    alignment: Alignment.center,
                    height: 60,
                    child: ClipOval(
                      child: Image.asset(
                        "lib/app/assets/g1.jpg",
                        fit: BoxFit.cover,
                      ),
                    ),
                  ),
                  SizedBox(height: 10,),
                  Container(
                    alignment: Alignment.center,
                    child: Text('张三'),
                  ),
                  SizedBox(height: 10,),
                  Container(
                    alignment: Alignment.center,
                    child: Text('15838337244'),
                  )
                ],
              ),
            ),
            decoration: BoxDecoration(
              gradient: LinearGradient(
                colors: [
                  Colors.purpleAccent.withOpacity(0.25),
                  Colors.blue.shade300.withOpacity(0.4),
                ],
                begin: Alignment.centerLeft,
                end: Alignment.centerRight,
              ),
            ),
          ),
          Container(
            height: 300,
            width: double.infinity,
            child: GridView.count(
              crossAxisCount: 4, // 每行3个
              crossAxisSpacing: 10, // 水平间距
              mainAxisSpacing: 10, // 垂直间距
              padding: EdgeInsets.all(10), // 整体边距
              children: [
                Container(
                  color: Colors.greenAccent,
                  alignment: Alignment.center,
                  child: Text('订单'),
                ),
                Container(
                  color: Colors.greenAccent,
                  alignment: Alignment.center,
                  child: Text('门票'),
                ),
                Container(
                  color: Colors.greenAccent,
                  alignment: Alignment.center,
                  child: Text('钱包'),
                ),
                Container(
                  color: Colors.greenAccent,
                  alignment: Alignment.center,
                  child: Text('反馈'),
                ),
                Container(
                  color: Colors.greenAccent,
                  alignment: Alignment.center,
                  child: Text('公告'),
                ),
                Container(
                  color: Colors.greenAccent,
                  alignment: Alignment.center,
                  child: Text('消息'),
                ),
                Container(
                  color: Colors.greenAccent,
                  alignment: Alignment.center,
                  child: Text('客服'),
                ),
                Container(
                  color: Colors.greenAccent,
                  alignment: Alignment.center,
                  child: Text('设置'),
                ),

              ],
            ),
          ),
        ],
      ),
      alignment: Alignment.center,
    );
  }
}
